#include<bits/stdc++.h>

using namespace std;
using i64 = long long;
using pii = pair<int, int>;


int read() {
	int x = 0, f = 0; char ch = getchar();
	while (!isdigit(ch)) f |= (ch == '-'), ch = getchar();
	while (isdigit(ch)) x = x * 10 + (ch - '0'), ch = getchar();
	return x;
}
int __stk[128], __len;
void put(i64 x) {
	if (x < 0) putchar('-'), x = -x;
	do { __stk[++__len] = x % 10; }while (x /= 10);
	while (__len) putchar(__stk[__len--] + '0');
}
int main() {
//	freopen(".in", "r", stdin);
	freopen("soft.in", "w", stdout);
	srand(time(0));
	int n = 20000, k = 50;
	cout << n<<" "<<k<<'\n'; 
	for (int i = 2; i <= n; ++i) 
		cout << i<<" "<<(rand() % (i - 1) + 1)<<'\n';
	return 0;
}

